package com.example.cloud.model.basic;

import com.example.cloud.model.common.CommonModel;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Transient;
import java.math.BigDecimal;

/**
 * Created by wangtao on 2018/6/5.
 * 医药产品
 */
@Entity(name = "basic_product")
@Data
@EqualsAndHashCode(callSuper = false)
public class Product extends CommonModel {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    // 名称
    @Column(name = "name")
    private String name;
    // 产品大类
    @Column(name = "big_class_id")
    private Long bigClassId;
    @Column(name = "big_class_name")
    private String bigClassName;
    // 产品小类
    @Column(name = "small_class_id")
    private Long smallClassId;
    @Column(name = "small_class_name")
    private String smallClassName;
    // 单位主键
    @Column(name = "unit_id")
    private Long unitId;
    // 单位名称
    @Column(name = "unit_name")
    private String unitName;
    // 是否是药品{0：非药品 1：药品}
    @Column(name = "is_drug", columnDefinition = "INT DEFAULT 0")
    private int isDrug;
    // 是否毒麻药{0：否 1：是}
    @Column(name = "toxic", columnDefinition = "INT DEFAULT 0")
    private int toxic;
    // 是否注射类{0：否 1：是}
    @Column(name = "inject", columnDefinition = "INT DEFAULT 0")
    private int inject;
    // 价格
    @Column(name = "price")
    private BigDecimal price;
    // 包装规格
    @Column(name = "pack_specific")
    private String packSpecific;
    // 主要功效成分
    @Column(name = "effect", length = 1000)
    private String effect;
    // 全成分配方
    @Column(name = "ingredient", length = 1000)
    private String ingredient;
    // 适用症状
    @Column(name = "symptom", length = 1000)
    private String symptom;
    // 使用方法
    @Column(name = "instructions", length = 1000)
    private String instructions;
    // 产品特点
    @Column(name = "features", length = 1000)
    private String features;
    // 公司及产地
    @Column(name = "company", length = 1000)
    private String company;
    // 推荐指数
    @Column(name = "recommend")
    private String recommend;
    // 库存标识{0：未生成 1：已生成}
    @Column(name = "inventory_flag", columnDefinition = "INT default 0")
    private int inventoryFlag;
    // 账户编号
    @Column(name = "account_id")
    private Long accountId;
    // 用户编号
    @Column(name = "user_id")
    private Long userId;
    // 组织机构编号
    @Column(name = "organ_id")
    private Long organId;
    // 组织机构名称
    @Column(name = "organ_name")
    private String organName;
    @Transient
    private int quantity;
}
